<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/templates/portalTemplate.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:my="http://java.sun.com/jsf/composite/components">
	<ui:define name="content">
		<h:form>
			<rich:panel header="Teksty aplikacji">
				<h:commandButton value="Zapisz"
					action="#{applicationTextBrowser.save()}" />
				<h:commandButton value="Wyczyść cache sesji"
					action="#{_text.celarCache()}" />
				<rich:dataGrid value="#{applicationTextBrowser.texts}" var="_row">
					<h:panelGrid columns="1">
						<h:outputText value="#{_row.id}:" />
						<h:inputTextarea value="#{_row.text}" cols="80" rows="4"
							rendered="#{_row.type != 'HTML'}" />
						<rich:editor value="#{_row.text}"
							rendered="#{_row.type != 'TEXT'}" toolbar="custom">
							<f:facet name="config">
	                    toolbar_custom:
	                        [
	                            { name: 'document', items : [ 'NewPage','Preview' ] },
	                            { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
	                            { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','Scayt' ] },
	                            { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ] },
	                                    '/',
	                            { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
								{ name: 'colors', items : [ 'TextColor','BGColor' ] },
	                            { name: 'basicstyles', items : [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
	                            { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ] },
	                            { name: 'links', items : [ 'Link','Unlink' ] }
	                        ]
	                    </f:facet>
						</rich:editor>
					</h:panelGrid>

				</rich:dataGrid>
				<h:commandButton value="Zapisz"
					action="#{applicationTextBrowser.save()}" />
				<h:commandButton value="Wyczyść cache sesji"
					action="#{_text.celarCache()}" />

			</rich:panel>
		</h:form>

	</ui:define>
</ui:composition>